package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ExpenditureMapper;
import com.ruoyi.system.domain.Expenditure;
import com.ruoyi.system.service.IExpenditureService;

/**
 * 支出Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-10
 */
@Service
public class ExpenditureServiceImpl implements IExpenditureService 
{
    @Autowired
    private ExpenditureMapper expenditureMapper;

    /**
     * 查询支出
     * 
     * @param id 支出主键
     * @return 支出
     */
    @Override
    public Expenditure selectExpenditureById(Long id)
    {
        return expenditureMapper.selectExpenditureById(id);
    }

    /**
     * 查询支出列表
     * 
     * @param expenditure 支出
     * @return 支出
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<Expenditure> selectExpenditureList(Expenditure expenditure)
    {
        return expenditureMapper.selectExpenditureList(expenditure);
    }

    /**
     * 新增支出
     * 
     * @param expenditure 支出
     * @return 结果
     */
    @Override
    public int insertExpenditure(Expenditure expenditure)
    {
        return expenditureMapper.insertExpenditure(expenditure);
    }

    /**
     * 修改支出
     * 
     * @param expenditure 支出
     * @return 结果
     */
    @Override
    public int updateExpenditure(Expenditure expenditure)
    {
        return expenditureMapper.updateExpenditure(expenditure);
    }

    /**
     * 批量删除支出
     * 
     * @param ids 需要删除的支出主键
     * @return 结果
     */
    @Override
    public int deleteExpenditureByIds(Long[] ids)
    {
        return expenditureMapper.deleteExpenditureByIds(ids);
    }

    /**
     * 删除支出信息
     * 
     * @param id 支出主键
     * @return 结果
     */
    @Override
    public int deleteExpenditureById(Long id)
    {
        return expenditureMapper.deleteExpenditureById(id);
    }

    /**
     * 审核支出
     *
     * @param expenditure 支出
     * @return 结果
     */
    @Override
    public int auditeExpenditure(Expenditure expenditure)
    {
        return expenditureMapper.auditeExpenditure(expenditure);
    }
}
